<%
metamodel http://www.eclipse.org/uml2/2.0.0/UML
import org.acceleo.modules.uml2.services.Uml2Services
import org.acceleo.modules.uml2.services.StringServices
%>
<%script type="Class" name="utilityPackage"%>
org.taam.test.utility


<%script type="Class" name="fullFilePath"%>
/<%utilityPackage.toPath()%>/Utility.java


<%script type="Class" name="generate" file="<%fullFilePath%>"%>

package <%utilityPackage%>;

public class Utility{
/**
	 * Return the String with the first letter uppercase. Useful for class name.
	 */
	public static String firstUpper(String s) {
		if (s.length() > 0) 
			s = Character.toUpperCase(s.charAt(0)) + s.substring(1);
		return s;
	}

	/**
	 * Return the String with the first letter lowercase. Useful for attribute name.
	 */
	public static String firstLower(String s)  {
		if (s.length() > 0) 
			s = Character.toLowerCase(s.charAt(0)) + s.substring(1);
		return s;
	}
	
	/**
	 * Transform a String with notation aa.bb.cc to aa/bb/cc<br/>
	 * Usefull for package translating.
	 */
	public static String toPath(String packageName){
		return packageName.trim().replaceAll("\\.","/");
	}
}